﻿@using System.Collections.Generic;
@using Think.Lenovo.Com.Models;
@using Think.Lenovo.Com.Models.Users;
@using System.Web.Mvc.Html;
<html>
<head>
    <link href="/Contents/css/skin.css" rel="stylesheet" type="text/css" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Cache-Control" content="no" />
    <link rel="stylesheet" type="text/css" href="/Contents/resources/css/reset.css" />
    <link rel="stylesheet" type="text/css" href="/Contents/resources/css/style.css" media="screen" />
    <link id="color" rel="stylesheet" type="text/css" href="/Contents/resources/css/colors/blue.css" />
    <script type="text/javascript" src="/Scripts/lib/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="/Scripts/lib/SerializeObject.js"></script>
    <script type="text/javascript" src="/Scripts/ViewManageRole.js"></script>
</head>
<body>
    <div id="content" style="background: url(/Contents/resources/images/background.png);">
        <!-- content / right -->
        <div id="right">
            <!-- table -->
            <div class="box">
                <!-- box / title -->
                <div class="title">
                    <h5>
                        角色管理</h5>
                </div>
                <div class="table">
                    <table style="border: 0px;">
                        <tr style="border: none;">
                            <td>
                                角色编码
                            </td>
                            <td>
                                <input type="text" id="Code" value="" maxlength="4" size="5" />
                            </td>
                            <td>
                                角色名称
                            </td>
                            <td>
                                <input type="text" id="Name" value="" maxlength="10" size="15" />
                            </td>
                            <td>
                                排序序号
                            </td>
                            <td>
                                <input type="text" id="Seq" maxlength="9" size="5" />
                            </td>
                            <td>
                                <input type="button" name="" value="保存角色" onclick="SaveRole();" />
                                <input type="hidden" id="roleId" value="undefined" />
                                <input type="button" id="CancelEditBtn" value="取消修改" onclick="reset();" disabled="disabled" />
                            </td>
                        </tr>
                    </table>
                    <hr />
                    <table id="userLevelList" style="table-layout: auto;" width="100%" cellpadding="0"
                        cellspacing="0">
                        <tr>
                            <td align="center">
                                <font color='green'>角色编码</font>
                            </td>
                            <td align="center">
                                <font color='green'>角色名称</font>
                            </td>
                            <td align="center">
                                <font color='green'>排序序号</font>
                            </td>
                            <td align="center">
                                <font color='green'>操作</font>
                            </td>
                        </tr>
                        @{
                            foreach (RoleModel item in (LinkedList<RoleModel>)ViewData["list"])
                            {
                            <tr>
                                <td align="center">@item.Code
                                </td>
                                <td align="center">@item.Name
                                </td>
                                <td align="center">@item.Seq
                                </td>
                                <td align="center">
                                    <a href="#" onclick="bindData(@item.Id);">修改</a> <span>|</span>
                                    @if(@item.Code != "D001")
                                         {
                                             <a href="#" onclick="getUserLevel(@item.Id);">分配等级</a> <span>|</span>
                                         }
                                    <a href="/User/ViewGrantPowerToUser/@item.Id">分配权限</a>
                                </td>
                            </tr>
                            }
                        }
                    </table>
                    <!-- 用户等级容器 -->
                    <div id="userLevelContainer">
                    </div>
                    @*<input type="hidden" id="dataPool" value="" />*@
                    <textarea id="dataPool" style="display: none"></textarea>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
